using UnityEngine;
using System.Collections;

public class SetTargetRotationToCounterCharacter : CharacterAction
{  
	public override void OnActionEnter (Character character)
	{
		onFrameUpdate = false;
		if(character.counterCharacters.Count != 0)
		{
			Character target = character.counterCharacters[character.counterCharacters.Count - 1];
            character.transformRef.LookAt(target.transformRef.position);
            character.transformRef.rotation = Quaternion.Euler(new Vector3(0, character.transformRef.rotation.eulerAngles.y, 0));
            character.targetRotation = character.transformRef.rotation.eulerAngles.y;
		}
	}
}


